#ifndef _NE_SCREEN_H_
#define _NE_SCREEN_H_

#include <mathematics/Vector2.h>

namespace ne
{
    class NEAPI Screen
    {
        public:
            class Listener
            {
                public:
                    Listener() {}
                    virtual ~Listener() {}
                    virtual void onResolutionChange(const uint32_t width, const uint32_t height) {}
                    virtual void onFullScreenChange(const bool b) {}
            };

            typedef std::list<Listener*> ListenerList;
            typedef ListenerList::iterator ListenerListIterator;
            typedef ListenerList::const_iterator ListenerListConstIterator;

        public:
            Screen();

            void setResolution(const uint32_t width, const uint32_t height);
            Vector2 getResolution() const { return Vector2(mWidth, mHeight); }

            uint32_t getWidth() const { return mWidth; }
            uint32_t getHeight() const { return mHeight; }

            void setFullScreen(const bool b);
            bool isFullScreen() const { return mFullScreen; }

            // TODO: Do not add too many Listeners
            void addListener(Listener *pListener);
            void removeListener(Listener *pListener);

            virtual ~Screen();

        private:
            void _fireResolutionChange();

            void _fireFullScreenChange();

            Screen(const Screen &);

            Screen& operator = (const Screen &);

        private:
            uint32_t mWidth;
            uint32_t mHeight;
            bool mFullScreen;
            ListenerList mListenerList;
    };
}

#endif
